import { createApp } from 'vue'
import App from './App.vue'
import router from './router'

import './assets/main.css'

import UserLogin from './views/UserLogin.vue'
import AdminLogin from './views/AdminLogin.vue'
import Backend from './views/Backend.vue'
import Register1 from './views/Register1.vue'
import AdminSetting from '@/components/UCenter/mainbody/admin/AdminSetting.vue'
import Register from './views/Register.vue'
import ForgetPwd from './components/UCenter/login/ForgetPwd.vue'
import slideVerify from './components/UCenter/save/slideVerify.vue'

const app = createApp(UserLogin)
//const app = createApp(App)

// export const eventBus = new Vue()
app.use(router)




//导入Element-plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
app.use(ElementPlus)

//导入Element的小图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

//安装axios模块
//npm i axios --S
//导入
import axios from 'axios'//如果是目录，则查找axios.js-no->index.js->目录
//全局注册
axios.defaults.baseURL = 'http://localhost:8080/UCenter'
//作为属性的方式来全局注册，使用时可以用this.xxx的方式使用它，而不是标签
// app.config.globalProperties.$http = axios
app.provide('$http',axios)

//导入滑块验证
//npm install--save vue3 - slide - verify
import SlideVerify from 'vue3-slide-verify'

app.mount('#app')